<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NanoCef</title>
    <link rel="icon" href="data:;base64,=">
</head>
<body>
    <h1>NanoCef</h1>
    <button onclick="myFunction()">点击我</button>
    <p>单击按钮触发一个函数，该函数将在 id="demo" 的 p 元素中输出 "Hello World"。</p>
    <p id="demo"></p>
</body>
<script>
    async function myFunction() {
        //window.doChili();
        return new Promise((accept, reject) => window.doChili("I am from index.html", accept => {
            document.getElementById("demo").innerHTML = accept ? "YES" : "NO";
        }, reject => {
            document.getElementById("demo").innerHTML = reject;
        }))
    }
</script>
</html>